home *** CD-ROM | disk | FTP | other *** search
/ PCGUIA 117 / PC Guia 117.iso / Software / Utils / Software2 / Product11 / Setup.exe / MT-3.16-full-en_US / mt.cgi < prev    next >
Text File  |  2005-03-08  |  736b  |  32 lines

  1. #!/usr/bin/perl -w
  2.   
  3. # Copyright 2001-2005 Six Apart. This code cannot be redistributed without
  4. # permission from www.movabletype.org.
  5. #
  6. # $Id: mt.cgi 10197 2005-03-09 00:27:57Z ezra $
  7. use strict;
  8.  
  9. my($MT_DIR);
  10. BEGIN {
  11.     if ($0 =~ m!(.*[/\\])!) {
  12.         $MT_DIR = $1;
  13.     } else {
  14.         $MT_DIR = './';
  15.     }
  16.     unshift @INC, $MT_DIR . 'lib';
  17.     unshift @INC, $MT_DIR . 'extlib';
  18. }
  19.  
  20. eval {
  21.     require MT::App::CMS;
  22.     my $app = MT::App::CMS->new( Config => $MT_DIR . 'mt.cfg',
  23.                                  Directory => $MT_DIR )
  24.         or die MT::App::CMS->errstr;
  25.     local $SIG{__WARN__} = sub { $app->trace($_[0]) };
  26.     $app->run;
  27. };
  28. if ($@) {
  29.     print "Content-Type: text/html\n\n";
  30.     print "Got an error: $@";
  31. }
  32.